const fs = require("fs")
const path  = require("path");
const dangqian = path.join(__dirname+'/1-10单元视频/');
const video = fs.readdirSync("1-10单元视频");
var num = 13
function fsss(arr,src){
    arr.forEach(item=>{
        const items = fs.readdirSync(path.join(src+item))
        const videoMp4 = items.filter(im=>im.includes(".mp4"))
        const oldsrc = path.join(src+item+`/${videoMp4[0]}`)
        const newsrc = "D:/MyWeb/录屏/高级node/肖耀霆/"
        fs.stat(oldsrc,(err,stats)=>{
            if(videoMp4.length>0){
                // console.log(newsrc+String(stats.ctime)+".mp4");
                num+=1;
                fs.copyFileSync(oldsrc,newsrc+"2021-10-"+num+".mp4")
            }
        })
        
    })
}
fsss(video,dangqian)